package proxy;

import proxy.db.OrderServiceDynamicProxy;

//动态代理（重要）
public class Test {
    public static void main(String[] args) {
        Order order = new Order();
        order.setUserId(1);
        //动态代理模式（重要）
        //OrderServiceDynamicProxy 返回的就是接口，因为代理的就是接口
        IOrderService orderServiceDynamicProxy = (IOrderService)new OrderServiceDynamicProxy(new IOrderServiceImpl()).bind();


        orderServiceDynamicProxy.saveOrder(order);

        System.out.println("==================");

        IOrderService sd = new IOrderServiceImpl();
        sd.saveOrder(order);
    }
}